/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    margin: 0;
    padding: 0;
}

/* 游戏容器 */
.game-container {
    width: 100vw;
    height: 100vh;
    background: #000;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* 游戏头部 */
.game-header {
    background: linear-gradient(90deg, #1a1a2e, #16213e);
    height: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    border-bottom: 2px solid #444;
}

.score-panel {
    display: flex;
    gap: 30px;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
}

.score-panel span {
    color: #00ff41;
    text-shadow: 0 0 10px #00ff41;
    white-space: nowrap;
}

/* 血条UI样式 */
.health-bar-container {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
}

.health-bar-label {
    font-size: 14px;
    font-weight: bold;
    color: #ff4444;
    text-shadow: 0 0 5px #ff4444;
    min-width: 32px;
}

.health-bar-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.health-bar-background {
    position: relative;
    width: 150px;
    height: 20px;
    background: linear-gradient(90deg, #1a1a1a, #2a2a2a);
    border: 2px solid #444;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        0 0 10px rgba(255, 68, 68, 0.3);
}

.health-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 8px;
    transition: width 0.3s ease-out;
}

/* 过渡血条（类似拳皇游戏的效果） */
.health-bar-transition {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.8) 0%,
        rgba(255, 255, 0, 0.8) 30%,
        rgba(255, 165, 0, 0.8) 70%,
        rgba(255, 0, 0, 0.6) 100%
    );
    z-index: 1;
    /* 过渡动画：缓慢减少 */
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 当前血条 */
.health-bar-current {
    background: linear-gradient(90deg, 
        #44ff44 0%,
        #ffff44 50%,
        #ff4444 100%
    );
    z-index: 2;
    box-shadow: 
        0 0 10px rgba(68, 255, 68, 0.5),
        inset 0 2px 5px rgba(255, 255, 255, 0.3);
    /* 当前血量立即变化 */
    transition: width 0.1s ease-out;
}

/* 血条颜色变化 */
.health-bar-current.health-high {
    background: linear-gradient(90deg, 
        #44ff44 0%,
        #66ff66 100%
    );
    box-shadow: 
        0 0 10px rgba(68, 255, 68, 0.7),
        inset 0 2px 5px rgba(255, 255, 255, 0.3);
}

.health-bar-current.health-medium {
    background: linear-gradient(90deg, 
        #ffff44 0%,
        #ffaa44 100%
    );
    box-shadow: 
        0 0 10px rgba(255, 255, 68, 0.7),
        inset 0 2px 5px rgba(255, 255, 255, 0.3);
}

.health-bar-current.health-low {
    background: linear-gradient(90deg, 
        #ff4444 0%,
        #ff6666 100%
    );
    box-shadow: 
        0 0 10px rgba(255, 68, 68, 0.8),
        inset 0 2px 5px rgba(255, 255, 255, 0.3);
    animation: healthLowPulse 0.8s infinite;
}

/* 低血量闪烁效果 */
@keyframes healthLowPulse {
    0%, 100% { 
        box-shadow: 
            0 0 10px rgba(255, 68, 68, 0.8),
            inset 0 2px 5px rgba(255, 255, 255, 0.3);
    }
    50% { 
        box-shadow: 
            0 0 20px rgba(255, 68, 68, 1),
            0 0 30px rgba(255, 68, 68, 0.6),
            inset 0 2px 5px rgba(255, 255, 255, 0.3);
    }
}

.health-bar-text {
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    min-width: 40px;
    text-align: center;
}

.pause-btn {
    background: #ff6b35;
    color: white;
    border: none;
    padding: 4px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.pause-btn:hover {
    background: #e55a2b;
    transform: scale(1.05);
}

/* 游戏区域 */
.game-area {
    position: relative;
    width: 100%;
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* 游戏画布 */
#gameCanvas {
    background: linear-gradient(180deg, #000428 0%, #004e92 100%);
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1;
}

/* 游戏界面覆盖层 */
.game-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    z-index: 10;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 标题样式 */
.game-screen h1 {
    font-size: 48px;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #ff6b35, #f7931e);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    animation: glow 2s ease-in-out infinite alternate;
}

.game-screen h2 {
    font-size: 36px;
    margin-bottom: 30px;
    color: #ff6b35;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

@keyframes glow {
    from { text-shadow: 0 0 20px #ff6b35, 0 0 30px #ff6b35; }
    to { text-shadow: 0 0 30px #ff6b35, 0 0 40px #ff6b35; }
}

/* 说明文字 */
.game-screen p {
    font-size: 18px;
    margin-bottom: 10px;
    color: #ccc;
    text-align: center;
}

/* 按钮样式 */
.btn {
    background: linear-gradient(45deg, #ff6b35, #f7931e);
    color: white;
    border: none;
    padding: 15px 30px;
    margin: 10px;
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.4);
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.6);
}

.btn:active {
    transform: translateY(-1px);
}

/* 按钮点击效果 */
.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

/* 动画关键帧 */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 特殊效果 */
.score-panel #score,
.score-panel #lives {
    animation: pulse 2s infinite;
}

/* 隐藏滚动条 */
::-webkit-scrollbar {
    display: none;
}

body {
    -ms-overflow-style: none;
    scrollbar-width: none;
}